import type { Announcement } from "../models/Announcement";
import type { BaseResponse_Page_Announcement_ } from "../models/BaseResponse_Page_Announcement_";
import type { BaseResponse_string_ } from "../models/BaseResponse_string_";
import type { CancelablePromise } from "../core/CancelablePromise";
import { OpenAPI } from "../core/OpenAPI";
import { request as __request } from "../core/request";

export class AnnouncementControllerService {
  /**
   * Addannouncement
   * @param announcement announcement
   * @returns BaseResponse_string_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static addannouncementUsingPost(
    announcement: Announcement
  ): CancelablePromise<BaseResponse_string_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/announcement/addAnnouncement",
      body: announcement,
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }

  /**
   * listPage
   * @param current current
   * @param size size
   * @returns BaseResponse_Page_Announcement_ OK
   * @returns any Created
   * @throws ApiError
   */
  public static listPageUsingPost(
    current?: number,
    size?: number
  ): CancelablePromise<BaseResponse_Page_Announcement_ | any> {
    return __request(OpenAPI, {
      method: "POST",
      url: "/api/announcement/getList",
      query: {
        current: current,
        size: size,
      },
      errors: {
        401: `Unauthorized`,
        403: `Forbidden`,
        404: `Not Found`,
      },
    });
  }
}
